#ifndef __IP__H__
#define __IP__H__

typedef struct IP_INTERFACE_S
{
	unsigned char *data;
	unsigned int data_size;
	unsigned char version;
	unsigned char head_size;
	unsigned short size;
	unsigned short identification;
	unsigned char flag;
	unsigned short offset;
	unsigned char time_live;
	unsigned char protocol;
	unsigned short checksum;
	unsigned int src_ip;
	unsigned int dest_ip;
	int (*alloc)(struct IP_INTERFACE_S *, unsigned int, unsigned char, unsigned char *, unsigned int);
	int (*tobuf)(struct IP_INTERFACE_S *, unsigned char *, int);
	int (*free)(struct IP_INTERFACE_S *);
} IP_INTERFACE_T, *IP_INTERFACE_P;

extern void ip_init(unsigned char *ip);
extern void ip_get_interface(IP_INTERFACE_P *);

#endif